Skip to content

Make release prep output stable to reduce diff noise - #930

Closed
ngnatng wants to merge 1 commit into
mainfrom
stable-release-prep-output
Closed

ngnatng wants to merge 1 commit into
mainfrom
stable-release-prep-output

Conversation

@ngnatng

@ngnatng ngnatng commented Nov 10, 2026

Copy link
Copy Markdown

Makes the output of ./gradlew prepareRelease (and updateVersionToNextSnapshot) deterministic so release PRs only show real changes.

Problem: Every release prep PR / snapshot bump had ~80-140 lines of pure reordering noise:

  • UpdateVersionTask used Properties.store(), which reorders gradle.properties keys (JDK-dependent order) and adds a timestamp comment.
  • The license-report plugin writes third_party/LICENSES.{xml,html,json} in a nondeterministic order (e.g. 82 lines for 48.1.0, 118 for 47.0.0, all reorder-only).

Changes:

  • UpdateVersionTask rewrites only the version= line.
  • copyLicenses sorts each license report by dependency name (XML/HTML by text block, formatting preserved; JSON by name). Fails loudly if the report format is unexpected.
  • Removes the stale timestamp comment from gradle.properties.
  • Commits the sorted LICENSES.* (one-time reorder, no content change: same 55 entries, same lines/bytes) so the next release starts clean.

Testing:

  • ./gradlew prepareRelease -PnewVersion=48.1.2 run twice: second run produces no diff; gradle.properties only changes the version= line.
  • updateVersionToNextSnapshot: 48.1.2 -> 48.1.3-SNAPSHOT, 48.1.1-rc1 -> 48.1.1-SNAPSHOT, version line only.
  • verifyLicenses passes.

- UpdateVersionTask now rewrites only the `version=` line in
  gradle.properties instead of using Properties.store(), which reordered
  keys (in a JDK-dependent order) and added a timestamp comment.
- copyLicenses now sorts the entries in third_party/LICENSES.{xml,html,json}
  by dependency name. The license-report plugin emits them in a
  nondeterministic order, which reshuffled ~80-130 lines on every release
  even when no dependency changed.
- Removes the stale timestamp comment from gradle.properties and commits the
  sorted license reports so the next release prep starts from a clean
  baseline.

Verified by running `./gradlew prepareRelease -PnewVersion=48.1.2` twice:
the second run produces no diff, and updateVersion/updateVersionToNextSnapshot
change only the version line.

Change-Id: Idf80af67546f99ab4d7b5ffbe5629b11438a02d3
@ngnatng ngnatng closed this Nov 10, 2026
@ngnatng
ngnatng deleted the stable-release-prep-output branch November 10, 2026 16:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant